<?php 


 
    include 'load.php';
    $openid='ohFb-4x7S_n8SSiIojBs-EL8BAOI';
    $mysqli = new mysqli($dbhost, $dbuser, $dbpwd, $dbName);
    if (!$mysqli->set_charset("utf8")) {}
    $isold='new';
    $dizhi='';
    $queren='';
    $query=$mysqli->query("SELECT sheng,shi,dizhi,isold,queren FROM `uinfo` where openid='".$openid."' limit 0,1 ");
    if($query->num_rows>0){
        $uinfo=$query->fetch_array();
        $isold=$uinfo['isold'];
        $dizhi=$uinfo['sheng'].$uinfo['shi'].$uinfo['dizhi'];
        $queren=$uinfo['queren'];
    }
    
    $a=$b=$c='';
    $query=$mysqli->query("SELECT avatar FROM `users` where openid='".$openid."' limit 0,1 ");
    if($query->num_rows>0){
        $getUsers=$query->fetch_array();
        $a=array('a'=>$getUsers['avatar']);
        
    }
    $getshare=array();
    $query=$mysqli->query("SELECT zuopenid FROM `share` where openid='".$openid."' limit 0,4 ");
    if($query->num_rows>0){
        $theCon=NULL;
        $condition=array();
        while ($list = $query->fetch_array()){
            $condition[]=" openid='".$list['zuopenid']."' ";
        }
        if (!empty($condition)){
            $theCon=implode(' or ', $condition);
        }
        echo count($condition);
        echo "<br />";
        
        var_dump($condition);
        echo "<br /><br />";
        
        if (empty($theCon)){
            echo json_encode(array('msg'=>'no'));
            exit;
        }
        
        echo "SELECT avatar FROM `users` where ".$theCon." limit 0,3";
        
        $queryU=$mysqli->query("SELECT avatar FROM `users` where ".$theCon." limit 0,3 ");
        while ($list=$queryU->fetch_array()){
            $getshare[]=array('a'=>$list['avatar']);
        }
        if (isset($getshare[0])){
            $b=array('a'=>$getshare[0]['a']);
        }
        if (isset($getshare[1])){
            $c=array('a'=>$getshare[1]['a']);
        }
        
    }
    
    echo json_encode(array('msg'=>'h','A'=>$a,'B'=>$b,'C'=>$c,'num'=>count($getshare),'isold'=>$isold,'dizhi'=>$dizhi,'queren'=>$queren));
    
    $mysqli->close();
 



exit;
$MemberNo='M1001581308';
$url='https://member.elixir.com.cn/ugc/index.php/selim/get_membernoinfo?memberno='.$MemberNo;
$memberData=file_get_contents($url);

var_dump($memberData);


exit;
$token='ceb86b6e8666bf7d8b0fab1e1a0a5185';
$Password='ee8c2ba84fe467abf49229bfbfc06510';
$url='http://coapi.moji.com/whapi/json/lbsweather';
$lat='39.91488908';
$lon='116.40387397';
$timestamp=time();
$key=md5($Password.$timestamp.$lat.$lon);

$url.='?timestamp='.$timestamp.'&token='.$token.'&key='.$key;
$url.='&lat='.$lat.'&lon='.$lon;
 
$data=httpGet($url);
var_dump($data);

function httpGet($url){
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($curl, CURLOPT_TIMEOUT, 500);
    curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
    curl_setopt($curl, CURLOPT_URL, $url);
    $res = curl_exec($curl);
    curl_close($curl);
    return $res;
}
exit;
?>

/**
接口已按要求开通，接口详情如下：
合作伙伴名称：
ELIXIR怡丽丝尔
有效 时间：
2020-06-18 00:00:00 ~ 2020-09-30 23:59:59
经纬度调用方式
生成token：
ceb86b6e8666bf7d8b0fab1e1a0a5185
Password：
ee8c2ba84fe467abf49229bfbfc06510
Url：
http://coapi.moji.com/whapi/json/lbsweather?timestamp=0&token=ceb86b6e8666bf7d8b0fab1e1a0a5185&key=120e9cd076b8f6ae466bc3650abb8bf9&lat=39.91488908&lon=116.40387397
开放接口：实况、预报7天、24小时、空指、空指预报3天

登录信息：1792769469@qq.com / 密码：Elixir2019

7.8 号测试

http://elixir.omnimkt.com/elixir07/img/weather/qing.jpg


6d6038c1265bf60ab5aae79daefc67cf

*/



